﻿using ControlzEx.Standard;
using ScottPlot.Colormaps;
using SharpCompress;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace ProductionLine.Modules.ShareLib.Helpers {
    public static class Utils {
        /// <summary>
        /// 设置窗体弹出的坐标位置
        /// </summary>
        public static void SetWindowLocationWindow(this Window window) {
            window.Left = (SystemParameters.WorkArea.Width - window.Width) / 3;
            window.Top = (SystemParameters.WorkArea.Height - window.Height) / 3;
        }
        /// <summary>
        /// 是否为同一个对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="obj1"></param>
        /// <param name="obj2"></param>
        /// <returns></returns>
        public static bool IsSameOne<T>(T obj1, T obj2) {
            if (obj1 == null || obj2 == null) {
                MessageBox.Show("存在null的");
                return false;
            }
            if (obj1.Equals(obj2)) {
                MessageBox.Show("相等");
                return true;
            }
            if (!obj1.Equals(obj2)) {
                MessageBox.Show("不相等");
                return false;
            }
            return obj1.Equals(obj2);
        }

    }
}
